﻿using System.Data.Entity;
using System.Web;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;

namespace Backend.Data.Managers
{
    public class ApplicationRoleManagerx : RoleManager<IdentityRole>
    {
        public ApplicationRoleManagerx(IRoleStore<IdentityRole, string> roleStore)
            : base(roleStore)
        {
        }

        public static ApplicationRoleManagerx Create(IdentityFactoryOptions<ApplicationRoleManagerx> options, IOwinContext context)
        {
            return new ApplicationRoleManagerx(new RoleStore<IdentityRole>(context.Get<BackendDbContext>()));
        }
    }
}
